<template>
  <el-config-provider :locale="zhCn">
    <router-view :key="key" />
  </el-config-provider>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { isMobile, watchResize } from '@bassist/utils'
import axios from 'axios'
// 配置axios的baseUrl
axios.defaults.baseURL = 'http://119.29.216.71:35802'
// 默认带上token
axios.defaults.headers.common[
  'Authorization'
] = `Bearer ${window.localStorage.getItem('token')}`
const route = useRoute()
const key = computed(() => `${String(route.name || route.path)}-${new Date()}`)

watchResize(() => {
  document.body.className = `platform-${isMobile() ? 'mobile' : 'desktop'}`
})
</script>

<style>
@import './index.css';

.container {
  height: 100vh;
}
.header {
  height: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 0 20px;
}
.title {
  font: 700;
  font-size: large;
}
.logout {
  font-size: small;
}
.logout:hover {
  color: blue;
}
</style>
